package com.lanou.service.impl;

import com.lanou.bean.AdminInfo;
import com.lanou.bean.AdminModule;
import com.lanou.bean.ModuleInfo;
import com.lanou.bean.RoleInfo;
import com.lanou.mapper.AdminInfoMapper;
import com.lanou.mapper.ModuleInfoMapper;
import com.lanou.mapper.RoleInfoMapper;
import com.lanou.service.AdminInfoService;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;

/**
 * Created by dllo on 18/3/9.
 */
@Service
public class AdminInfoServiceImpl implements AdminInfoService {
    @Resource
    private AdminInfoMapper adminInfoMapper;

    @Override
    public AdminInfo selectAdmin(String username) {
        return adminInfoMapper.selectAdmin(username);
    }

    @Override
    public List<AdminModule> selectAdminModule() {

        List<AdminModule> adminModuleList = adminInfoMapper.selectAllAdminInfo();
        return adminModuleList;
    }

    @Override
    public AdminModule selectAllAdmin(int admin_id) {
        return adminInfoMapper.selectAllAdmin(admin_id);
    }

    @Override
    public void delectAdmin(int admin_id) {
        adminInfoMapper.delectAdmin(admin_id);
    }

    @Override
    public void insertAdmin(AdminInfo adminInfo) {
        adminInfoMapper.insertAdmin(adminInfo);
    }

    @Override
    public AdminModule selectAdminModuleById(int id) {
        return adminInfoMapper.seleAdminInfoById(id);
    }

    @Override
    public void upDataAdminInfo(String name, String namecode, String tel, String email, int adminId) {
         adminInfoMapper.upDataAdminInfo(name,namecode,tel,email,adminId);
    }

    @Override
    public void updateAdmin(String adminName, String tele, String email, int adminID) {
        adminInfoMapper.updateAdmin(adminName,tele,email,adminID);
    }

    @Override
    public void updataPsw(String psw, int adminId) {
        adminInfoMapper.updataPsw(psw,adminId);
    }




}
